package borge.web.teamspirit.trash;

import borge.web.teamspirit.client.TeamSpirit;

/**
 * GWT RCP does not support these enum declarations, so
 * we need to separate them from the Serie class
 * @author Andreas Borglin
 *
 */
public class SerieEnums {

    public enum Type {
        OUTDOOR_SERIE(TeamSpirit.getConstants().outdoor_serie()), 
        OUTDOOR_CUP(TeamSpirit.getConstants().outdoor_cup()), 
        INDOOR_SERIE(TeamSpirit.getConstants().indoor_serie()), 
        INDOOR_CUP(TeamSpirit.getConstants().indcoor_cup());
        
        private String iName;
        Type(String aName){
            iName = aName;
        }
        
        public String toString(){
            return iName;
        }    
    };
    
    public enum Status {
        NOT_STARTED(TeamSpirit.getConstants().not_started()), 
        ACTIVE(TeamSpirit.getConstants().active()), 
        ENDED(TeamSpirit.getConstants().ended());
        
        private String iName;
        Status(String aName){
            iName = aName;
        }
        
        public String toString(){
            return iName;
        }
       
    };
    
    public static Type getTypeFromString(String aType){
    	return Type.valueOf(aType);
    }
    
    public static Status getStatusFromString(String aStatus){
    	return Status.valueOf(aStatus);
    }
    
    public static String getLocalizedStatus(String aStatus){
    	Status status = Status.valueOf(aStatus);
    	return status.toString();
    }
    
    public static String getLocalizedType(String aType){
    	Type type = Type.valueOf(aType);
    	return type.toString();
    }
    
}
